package servlet;

import dto.CompanyModelDto;
import dto.IntroDuctModelDto;


import model.CompanyModel;
import model.IntroDuctModel;
import model.NavModel;
import service.ICommonService;
import service.IIntroDuctService;
import service.impl.CommonServiceImpl;
import service.impl.IntroDuctServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet("/company")
public class IntroDuctServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        ICommonService iCommonService =new CommonServiceImpl();
        req.setAttribute("companyModel", iCommonService.getCommonModelDto());
//        req.setAttribute("companyModel", new CompanyModelIo().getCompanyModel());
        //导航
//        req.setAttribute("navList", new NavModelIo().getNavListFromNote());//这是导航数据
        //公司介绍+轮播
        IIntroDuctService iIntroDuctService =new IntroDuctServiceImpl();
        req.setAttribute("introDuctModel",iIntroDuctService.getIntroDuctModel());
//        IntroDuctModelDto model = iIntroDuctService.getIntroDuctModel();
//        System.out.println(model.getContent()+"-----");
//        System.out.println(model.getImgList()+"+++++");
//        req.setAttribute("introDuctModel",iIntroDuctService.getImgList());
//        req.setAttribute("introDuctModel",new IntroDuctModelIo().getIntroDuctModel());
        req.getRequestDispatcher("/jsp/company.jsp").forward(req, resp);

    }
}
